<template>
  <div class="selxd">
    <dnav :data="['消毒管理', '消毒记录']" />
    <el-card>
      <el-table :data="xdlist" style="width: 100%">
        <el-table-column type="expand">
          <template slot-scope="props">
            <el-card>
              <el-descriptions :column="1">
                <el-descriptions-item label="任务名称">
                  {{ props.row.aname }}
                </el-descriptions-item>
                <el-descriptions-item label="完成状态">
                  {{ props.row.dstatus ? "已完成" : "未完成" }}
                </el-descriptions-item>
                <el-descriptions-item label="记录人">
                  {{ props.row.truename }}
                </el-descriptions-item>
                <el-descriptions-item label="记录人账号">
                  {{ props.row.username }}
                </el-descriptions-item>
                <el-descriptions-item label="任务分类 ">
                  {{ props.row.asst_name }}
                </el-descriptions-item>
                <el-descriptions-item label="科室 ">
                  {{ props.row.rname }}
                </el-descriptions-item>
                <el-descriptions-item label="完成时间 ">
                  {{ props.row.over_time }}
                </el-descriptions-item>
              </el-descriptions>
            </el-card>
          </template>
        </el-table-column>
        <el-table-column label="任务名称" prop="aname"> </el-table-column>
        <el-table-column label="完成状态">
          <template slot-scope="scope">
            <el-tag :type="scope.row.dstatus ? '' : 'danger'">
              {{ scope.row.dstatus ? "已完成" : "未完成" }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="记录人" prop="truename"> </el-table-column>
        <el-table-column label="完成时间" prop="over_time"> </el-table-column>
      </el-table>
      <el-pagination
        background
        layout="prev, pager, next"
        :total="total"
        @current-change="cutp"
      >
      </el-pagination>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      xdlist: [],
      total: 0,
    };
  },
  methods: {
    init(page, pagesize) {
      this.$api.Getxd({ page, pagesize }).then((res) => {
        console.log(res);
        if (res.data.code == 200) {
          this.xdlist = res.data.data;
          this.total = res.data.total;
        }
      });
    },
    cutp(v) {
      console.log(v);
      this.init(v, 5);
    },
  },
  mounted() {
    this.init(1, 5);
  },
};
</script>

<style>
</style>